home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2009 February / PCWFEB09.iso / Software / Linux / SLAX 6.0.8 / slax-6.0.8.iso / slax / base / 006-devel.lzm / usr / include / k3bintmapcombobox.h < prev    next >
Encoding:
C/C++ Source or Header  |  2008-05-27  |  2.2 KB  |  84 lines

  1. /* 
  2.  *
  3.  * $Id: k3bwritingmodewidget.cpp 554512 2006-06-24 07:25:39Z trueg $
  4.  * Copyright (C) 2006 Sebastian Trueg <trueg@k3b.org>
  5.  *
  6.  * This file is part of the K3b project.
  7.  * Copyright (C) 1998-2007 Sebastian Trueg <trueg@k3b.org>
  8.  *
  9.  * This program is free software; you can redistribute it and/or modify
  10.  * it under the terms of the GNU General Public License as published by
  11.  * the Free Software Foundation; either version 2 of the License, or
  12.  * (at your option) any later version.
  13.  * See the file "COPYING" for the exact licensing terms.
  14.  */
  15.  
  16. #ifndef _K3B_INT_MAP_COMBOBOX_H_
  17. #define _K3B_INT_MAP_COMBOBOX_H_
  18.  
  19. #include <kcombobox.h>
  20.  
  21. #include "k3b_export.h"
  22.  
  23. /**
  24.  * The K3bIntMapComboBox allows a simple selection of integer
  25.  * values.
  26.  *
  27.  * The K3bIntMapComboBox will create a WhatsThis help automatically from
  28.  * the description texts (if all are set). The ToolTip has to be set manually.
  29.  */
  30. class LIBK3B_EXPORT K3bIntMapComboBox : public KComboBox
  31. {
  32.   Q_OBJECT
  33.  
  34.  public:
  35.   K3bIntMapComboBox( QWidget* parent = 0, const char* name = 0 );
  36.   ~K3bIntMapComboBox();
  37.  
  38.   int selectedValue() const;
  39.  
  40.  signals:
  41.   /**
  42.    * Emitted if the selected value changes by user interaction.
  43.    */
  44.   void valueChanged( int );
  45.  
  46.   /**
  47.    * Emitted if the current highlighted value changed by user interaction.
  48.    */
  49.   void valueHighlighted( int );
  50.  
  51.  public slots:
  52.   /**
  53.    * If \a v has not been added via insertItem the selection will not be changed
  54.    */
  55.   void setSelectedValue( int v );
  56.  
  57.   void clear();
  58.  
  59.   /**
  60.    * Insert a new item
  61.    * \param value The integer value to insert
  62.    * \param text The text to be displayed in the combobox
  63.    * \param description The text to be used to describe the item in the whatsthis help
  64.    * \param index The position where to inserts the item. The item will be appended if index is negative.
  65.    *
  66.    * \return true if the item could be inserted. False if the value had already been inserted.
  67.    */
  68.   bool insertItem( int value, const QString& text, const QString& description, int index = -1 );
  69.  
  70.   void addGlobalWhatsThisText( const QString& top, const QString& bottom );
  71.  
  72.  private slots:
  73.   void slotItemActivated( int );
  74.   void slotItemHighlighted( int );
  75.  
  76.  private:
  77.   void updateWhatsThis();
  78.  
  79.   class Private;
  80.   Private* d;
  81. };
  82.  
  83. #endif
  84.